package com.qire.manhua.activity;

import android.os.Bundle;

import com.qire.antscore.annotation.RouteMapping;
import com.qire.antsrouter.inject.Autowired;
import com.qire.common.constant.Navigation;
import com.qire.common.inject.EventControllerInjector;
import com.qire.common.inject.ViewModelInjector;
import com.qire.common.support.base.BaseActivity;
import com.qire.common.utils.ThemeUtil;
import com.qire.manhua.R;
import com.qire.manhua.controller.ComicRankListOfHotController;
import com.qire.manhua.databinding.ActivityComicRankListOfHotBinding;
import com.qire.manhua.model.viewModel.impl.ComicRankListOfHotViewModel;

import androidx.annotation.Nullable;

/**
 * 热门的漫画排行榜页
 */
@RouteMapping(path = Navigation.Page.ComicRankListOfHotPage)
public class ComicRankListOfHotActivity extends BaseActivity<ActivityComicRankListOfHotBinding> {

    @Autowired
    int pageTabIndex = 0;

    @Autowired(injector = ViewModelInjector.class)
    ComicRankListOfHotViewModel viewModel;

    @Autowired(injector = EventControllerInjector.class)
    ComicRankListOfHotController controller;

    @Override
    public int layoutRid() {
        return R.layout.activity_comic_rank_list_of_hot;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeUtil.changeStatusBarLightOrDark(this, true, true);

        viewModel.onAddition(this, controller);

        viewModel.loadAllTabData();

        viewDataBinder().comicRankHotViewPager.setCurrentItem(pageTabIndex);
    }

}
